var gulp=require("gulp"),
cssmin=require("gulp-cssmin"),
babel = require('gulp-babel'),
tinypng_nokey = require('gulp-tinypng-nokey'),
uglify=require("gulp-uglify");

//css的压缩
gulp.task("perfect",()=>{
	//css压缩
	gulp.src("src/*/*.css")
		.pipe(cssmin())
		.pipe(gulp.dest("dist"))
	//js压缩并且降级
	gulp.src("src/*/*.js")
		.pipe(babel())
		.pipe(uglify())
		.pipe(gulp.dest("dist"))
	//图片压缩
	gulp.src("src/*/*/*.{png,jpg,jpeg,gif,ico}")
		.pipe(tinypng_nokey())
		.pipe(gulp.dest("dist"))
	//html复制
	gulp.src("src/*/*.html")
		.pipe(gulp.dest("dist"))
})
